package com.eight.cloud.mybatisplus.annotation.enums;

import lombok.Getter;

/**
 * @EnumName: MpSqlMethod
 * @Author: TXC
 * @Date: 2024-12-18 17:38
 **/
@Getter
public enum MpSqlMethod {
    SELECT_REAL_BY_ID("selectRealById", "根据id查询实体 忽略逻辑删除", "SELECT %s FROM %s WHERE %s=#{%s}"),
    SELECT_REAL_LIST("selectRealList", "查询满足条件所有数据 忽略逻辑删除", "<script>%s SELECT %s FROM %s %s %s %s\n</script>"),
    SELECT_REAL_BATCH_BY_IDS("selectRealBatchIds", "根据ID集合，批量查询数据 忽略逻辑删除", "<script>SELECT %s FROM %s WHERE %s IN (%s) %s </script>"),
    REAL_DELETE_BY_ID("realDeleteById", "根据ID 物理删除一条数据", "DELETE FROM %s WHERE %s=#{%s}"),
    REAL_DELETE("realDelete", "根据 entity 条件物理删除记录 ", "<script>\nDELETE FROM %s %s %s\n</script>");
    private final String method;
    private final String desc;
    private final String sql;

    MpSqlMethod(String method, String desc, String sql) {
        this.method = method;
        this.desc = desc;
        this.sql = sql;
    }

}
